import React from "react";
import { createBrowserRouter } from "react-router-dom";


const Home = React.lazy(() => import("../pages/home/index"));
const City = React.lazy(() => import("../pages/city/index"));
const Login = React.lazy(() => import("../pages/login/index"));
const My = React.lazy(() => import("../pages/my/index"));
const MainLayout = React.lazy(() => import("../pages/mainLayout/index"));

const router = createBrowserRouter([
 {
  path: '/',
  element: <MainLayout></MainLayout>,
  children: [{
    path: "/",
    element: <Home></Home>,
  }, {
    path: "/my",
    element: <My></My>,
  }]
 },
  {
    path: "/city",
    element: <City></City>,
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
]);


export default router